package 实例内部类;

class OutClass1 {
    public int a = 1;
    private int b = 2;
    public static int c = 3;

    class InnerClass1 {
        public int a = 100;
        public int a1 = 4;
        private int b1 = 5;
        public static int c1 = 6;

        public void test() {
            System.out.println("test被执行了");

            OutClass1 outClass1 = new OutClass1();
            System.out.println(outClass1.a);

            System.out.println(OutClass1.this.a);

            System.out.println(a);
            System.out.println(b);
            System.out.println(c);
            System.out.println(a1);
            System.out.println(b1);
            System.out.println(c1);
        }
    }
}

public class Test {
    public void testMethod(){
        class Inner{
            public int date1=1;
            public void func(){
                System.out.println("func");
            }
        }
        Inner inner=new Inner();
        inner.func();

    }
    public static void main(String[] args) {
//        如何实例话一个实例内部类对象
        OutClass1 outClass1 = new OutClass1();
        OutClass1.InnerClass1 innerClass = outClass1.new InnerClass1();
        innerClass.test();
    }
}